<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CryptoAuthLib: swi_uart_at90usb1287_asf.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CryptoAuthLib
   </div>
   <div id="projectbrief">Microchip CryptoAuthentication Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00560_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">swi_uart_at90usb1287_asf.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="a00560.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#ifndef SWI_UART_AT90USB1287_ASF_H</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#define SWI_UART_AT90USB1287_ASF_H</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &lt;asf.h&gt;</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00359.html">cryptoauthlib.h</a>&quot;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &quot;serial.h&quot;</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="a00993.html#gaf9d9d027ce20f528edea144203141714">   50</a></span>&#160;<span class="preprocessor">#define MAX_SWI_BUSES    1  // AT90USB1287 has only 1 port</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="a00993.html#gab45577245cf4a8ead70e2d56965f2df3">   52</a></span>&#160;<span class="preprocessor">#define RECEIVE_MODE     0  // UART Receive mode, RX enabled</span></div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="a00993.html#ga4b85133b317e72410ea0762d637d3460">   53</a></span>&#160;<span class="preprocessor">#define TRANSMIT_MODE    1  // UART Transmit mode, RX disabled</span></div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="a00993.html#gac55a27e4c3eae59bb1687eb7e8d1fe4b">   54</a></span>&#160;<span class="preprocessor">#define RX_DELAY        10  // Delay before responses come</span></div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="a00993.html#ga3f3816567a2f513dd0e1f9eb17992fb2">   55</a></span>&#160;<span class="preprocessor">#define TX_DELAY        90  // Delay before new flag is sent</span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="a01137.html">atcaSWImaster</a></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;{</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="comment">// struct usart_module for Atmel SWI interface</span></div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="a01137.html#ad1dd3236df177255a91b568170b70a74">   62</a></span>&#160;    usart_if <a class="code" href="a01137.html#ad1dd3236df177255a91b568170b70a74">usart_instance</a>;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keywordtype">int</span>      <a class="code" href="a01137.html#ad72ba8c994f4d0e5ce354e17f7c427c0">ref_ct</a>;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="comment">// for conveniences during interface release phase</span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="a01137.html#af5c011e6c2e8d49675f7029e8ec2c0a6">bus_index</a>;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;} <a class="code" href="a00993.html#ga257ed552f7d68eb1e5d3ca7baa01559a">ATCASWIMaster_t</a>;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<a class="code" href="a00173.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> <a class="code" href="a00993.html#ga003b63648f1a5f9eba274760559688f2">swi_uart_init</a>(<a class="code" href="a01137.html">ATCASWIMaster_t</a> *instance);</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<a class="code" href="a00173.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> <a class="code" href="a00993.html#ga0b1aad3936bf003686d8db7fa2be5132">swi_uart_deinit</a>(<a class="code" href="a01137.html">ATCASWIMaster_t</a> *instance);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00993.html#gaba296f70baf68b768d6c4bb9cf7ba67d">swi_uart_setbaud</a>(<a class="code" href="a01137.html">ATCASWIMaster_t</a> *instance, uint32_t baudrate);</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00993.html#gacc2a96c86ce4c07249b81bc6a7eb2e41">swi_uart_mode</a>(<a class="code" href="a01137.html">ATCASWIMaster_t</a> *instance, uint8_t mode);</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00993.html#gad640b598d581ee7c8a4c804bee602906">swi_uart_discover_buses</a>(<span class="keywordtype">int</span> swi_uart_buses[], <span class="keywordtype">int</span> max_buses);</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<a class="code" href="a00173.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> <a class="code" href="a00993.html#ga4a4d491006d9683d67838963706ac9c1">swi_uart_send_byte</a>(<a class="code" href="a01137.html">ATCASWIMaster_t</a> *instance, uint8_t data);</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<a class="code" href="a00173.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> <a class="code" href="a00993.html#ga93f3dab17c14f71641ca970998ede823">swi_uart_receive_byte</a>(<a class="code" href="a01137.html">ATCASWIMaster_t</a> *instance, uint8_t *data);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="preprocessor">#endif // SWI_UART_AT90USB1287_ASF_H</span></div><div class="ttc" id="a01137_html_ad1dd3236df177255a91b568170b70a74"><div class="ttname"><a href="a01137.html#ad1dd3236df177255a91b568170b70a74">atcaSWImaster::usart_instance</a></div><div class="ttdeci">usart_if usart_instance</div><div class="ttdef"><b>Definition:</b> swi_uart_at90usb1287_asf.h:62</div></div>
<div class="ttc" id="a00359_html"><div class="ttname"><a href="a00359.html">cryptoauthlib.h</a></div><div class="ttdoc">Single aggregation point for all CryptoAuthLib header files.</div></div>
<div class="ttc" id="a01137_html_ad72ba8c994f4d0e5ce354e17f7c427c0"><div class="ttname"><a href="a01137.html#ad72ba8c994f4d0e5ce354e17f7c427c0">atcaSWImaster::ref_ct</a></div><div class="ttdeci">int ref_ct</div><div class="ttdef"><b>Definition:</b> hal_swi_bitbang.h:66</div></div>
<div class="ttc" id="a00173_html_a22bd6643f31f1d75dc3e7ea939f468cd"><div class="ttname"><a href="a00173.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a></div><div class="ttdeci">ATCA_STATUS</div><div class="ttdef"><b>Definition:</b> atca_status.h:41</div></div>
<div class="ttc" id="a00993_html_ga0b1aad3936bf003686d8db7fa2be5132"><div class="ttname"><a href="a00993.html#ga0b1aad3936bf003686d8db7fa2be5132">swi_uart_deinit</a></div><div class="ttdeci">ATCA_STATUS swi_uart_deinit(ATCASWIMaster_t *instance)</div><div class="ttdoc">Implementation of SWI UART deinit.</div><div class="ttdef"><b>Definition:</b> swi_uart_at90usb1287_asf.c:98</div></div>
<div class="ttc" id="a00993_html_ga003b63648f1a5f9eba274760559688f2"><div class="ttname"><a href="a00993.html#ga003b63648f1a5f9eba274760559688f2">swi_uart_init</a></div><div class="ttdeci">ATCA_STATUS swi_uart_init(ATCASWIMaster_t *instance)</div><div class="ttdoc">Implementation of SWI UART init.</div><div class="ttdef"><b>Definition:</b> swi_uart_at90usb1287_asf.c:64</div></div>
<div class="ttc" id="a00993_html_gaba296f70baf68b768d6c4bb9cf7ba67d"><div class="ttname"><a href="a00993.html#gaba296f70baf68b768d6c4bb9cf7ba67d">swi_uart_setbaud</a></div><div class="ttdeci">void swi_uart_setbaud(ATCASWIMaster_t *instance, uint32_t baudrate)</div><div class="ttdoc">implementation of SWI UART change baudrate.</div><div class="ttdef"><b>Definition:</b> swi_uart_at90usb1287_asf.c:110</div></div>
<div class="ttc" id="a00993_html_ga4a4d491006d9683d67838963706ac9c1"><div class="ttname"><a href="a00993.html#ga4a4d491006d9683d67838963706ac9c1">swi_uart_send_byte</a></div><div class="ttdeci">ATCA_STATUS swi_uart_send_byte(ATCASWIMaster_t *instance, uint8_t data)</div><div class="ttdoc">HAL implementation of SWI UART send byte over ASF. This function send one byte over UART.</div><div class="ttdef"><b>Definition:</b> swi_uart_at90usb1287_asf.c:160</div></div>
<div class="ttc" id="a00993_html_gacc2a96c86ce4c07249b81bc6a7eb2e41"><div class="ttname"><a href="a00993.html#gacc2a96c86ce4c07249b81bc6a7eb2e41">swi_uart_mode</a></div><div class="ttdeci">void swi_uart_mode(ATCASWIMaster_t *instance, uint8_t mode)</div><div class="ttdoc">implementation of SWI UART change mode.</div><div class="ttdef"><b>Definition:</b> swi_uart_at90usb1287_asf.c:122</div></div>
<div class="ttc" id="a00993_html_ga93f3dab17c14f71641ca970998ede823"><div class="ttname"><a href="a00993.html#ga93f3dab17c14f71641ca970998ede823">swi_uart_receive_byte</a></div><div class="ttdeci">ATCA_STATUS swi_uart_receive_byte(ATCASWIMaster_t *instance, uint8_t *data)</div><div class="ttdoc">HAL implementation of SWI UART receive bytes over ASF. This function receive one byte over UART.</div><div class="ttdef"><b>Definition:</b> swi_uart_at90usb1287_asf.c:209</div></div>
<div class="ttc" id="a00993_html_ga257ed552f7d68eb1e5d3ca7baa01559a"><div class="ttname"><a href="a00993.html#ga257ed552f7d68eb1e5d3ca7baa01559a">ATCASWIMaster_t</a></div><div class="ttdeci">struct atcaSWImaster ATCASWIMaster_t</div><div class="ttdoc">this is the hal_data for ATCA HAL for SWI UART</div></div>
<div class="ttc" id="a01137_html"><div class="ttname"><a href="a01137.html">atcaSWImaster</a></div><div class="ttdoc">This is the hal_data for ATCA HAL.</div><div class="ttdef"><b>Definition:</b> hal_swi_bitbang.h:63</div></div>
<div class="ttc" id="a00993_html_gad640b598d581ee7c8a4c804bee602906"><div class="ttname"><a href="a00993.html#gad640b598d581ee7c8a4c804bee602906">swi_uart_discover_buses</a></div><div class="ttdeci">void swi_uart_discover_buses(int swi_uart_buses[], int max_buses)</div><div class="ttdoc">discover UART buses available for this hardware this maintains a list of logical to physical bus mapp...</div><div class="ttdef"><b>Definition:</b> swi_uart_at90usb1287_asf.c:146</div></div>
<div class="ttc" id="a01137_html_af5c011e6c2e8d49675f7029e8ec2c0a6"><div class="ttname"><a href="a01137.html#af5c011e6c2e8d49675f7029e8ec2c0a6">atcaSWImaster::bus_index</a></div><div class="ttdeci">int bus_index</div><div class="ttdoc">for conveniences during interface release phase</div><div class="ttdef"><b>Definition:</b> hal_swi_bitbang.h:68</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_e870e4dac26de7990352b1cb7547818f.html">hal</a></li><li class="navelem"><a class="el" href="a00560.html">swi_uart_at90usb1287_asf.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
